// components/nav/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: String,
    isFirst: Boolean,
    isLatest: Boolean
  },

  /**
   * 组件的初始数据
   */
  data: {
    prevSrc: './images/prev.png',
    prevDisSrc: './images/prev@dis.png',
    nextSrc: './images/next.png',
    nextDisSrc: './images/next@dis.png'
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handlePrev (e) {
      if (!this.properties.isLatest) {
        this.triggerEvent('on-prev', {}, {})
      }
    },

    handleNext (e) {
      if (!this.properties.isFirst) {
        this.triggerEvent('on-next', {}, {})
      }
    }
  }
})
